package com.hd.controller.push;

import org.apache.logging.log4j.LogManager;

import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hd.controller.base.BaseController;
/**
 * 极光推送
 * @author hzhh123
 *
 */
@Controller
@RequestMapping("/jpush")
public class JpushController extends BaseController {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = LogManager.getLogger(JpushController.class.getName());
	@ResponseBody
	@RequestMapping("/jpush")
	public Object jpush() {
		String notification_title = "OA审批";
		String msg_content = "你有一个单号【9807】的单子需要审批！";
		String msg_title = "你有一个单号【9807】的单子需要审批！！";
		int status = JpushClientUtil.sendToAllAndroid(notification_title, msg_title, msg_content, "");
		if(status==1) {
			return renderSuccess(notification_title+"发送成功！");
		}else {
			return renderError("推送失败！");
		}
	}
	
}
